import 'package:safetymonitor/generated/json/base/json_field.dart';
import 'package:safetymonitor/generated/json/device_histroy_data_entity.g.dart';
import 'dart:convert';
export 'package:safetymonitor/generated/json/device_histroy_data_entity.g.dart';

@JsonSerializable()
class DeviceHistroyDataEntity {
	dynamic companyId;
	dynamic systemId;
	dynamic systemCode;
	dynamic deviceCode;
	late List<String> threshold;
	late List<DeviceHistroyDataPoints> points;
	late int notificationCategory;
	late List<DeviceHistroyDataThresholdVals> thresholdVals;
	dynamic queryStartTime;
	dynamic queryEndTime;

	DeviceHistroyDataEntity();

	factory DeviceHistroyDataEntity.fromJson(Map<String, dynamic> json) => $DeviceHistroyDataEntityFromJson(json);

	Map<String, dynamic> toJson() => $DeviceHistroyDataEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class DeviceHistroyDataPoints {
	 String name='';
	late int status;
	dynamic unit;
	late List<DeviceHistroyDataPointsData> data;

	DeviceHistroyDataPoints();

	factory DeviceHistroyDataPoints.fromJson(Map<String, dynamic> json) => $DeviceHistroyDataPointsFromJson(json);

	Map<String, dynamic> toJson() => $DeviceHistroyDataPointsToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class DeviceHistroyDataPointsData {
	late String time;
	late String value;

	DeviceHistroyDataPointsData();

	factory DeviceHistroyDataPointsData.fromJson(Map<String, dynamic> json) => $DeviceHistroyDataPointsDataFromJson(json);

	Map<String, dynamic> toJson() => $DeviceHistroyDataPointsDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class DeviceHistroyDataThresholdVals {
	late int alarmType;
	late double thresholdVal;
	dynamic color;
	late int notificationCategory;
	late int alarmLevel;

	DeviceHistroyDataThresholdVals();

	factory DeviceHistroyDataThresholdVals.fromJson(Map<String, dynamic> json) => $DeviceHistroyDataThresholdValsFromJson(json);

	Map<String, dynamic> toJson() => $DeviceHistroyDataThresholdValsToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}